<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/header.jsp" %>
<%@ include file="/common/datatables.jsp" %>
<div class="row">
	<div class="col-xs-12">
		<div class="row">
			<div class="col-xs-12">
				<div class="table-header">
					客户列表
				</div>
				<div>
					<table id="customerListTable" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								<th>客户姓名</th>
								<th>身份证号码</th>
								<th>联系电话</th>
								<th>工作单位</th>
								<th>家庭住址</th>
								<th>所属计划</th>
								<th>所属客户经理</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
						   <tr><td colspan="8" align="center">数据加载中...</td></tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>

<script type="text/javascript">


var scripts = [null, null];
$('.page-content-area').ace_ajax('loadScripts', scripts, function() {
	
	$.widget("ui.dialog", $.extend({}, $.ui.dialog.prototype, {
		_title: function(title) {
			var $title = this.options.title || '&nbsp;'
			if( ("title_html" in this.options) && this.options.title_html == true )
				title.html($title);
			else title.text($title);
		}
	}));
	
	
	var dataTables = $("#customerListTable").dataTable({
			"bProcessing": true,
			"bServerSide": true,
			"bSort": false,
			"bFilter": false,
			"bAutoWidth": false,
			"sPaginationType": "full_numbers",
			"oLanguage" : oLanguage,
			"fnServerParams": function ( aoData ) {
					aoData.push( { "name": "wtCustId", "value": "${customer.wtCustId}" } );
					aoData.push( { "name": "wtCustName", "value": "${customer.wtCustName}" } );
					aoData.push( { "name": "wtCustCardno", "value": "${customer.wtCustCardno}" } );
					aoData.push( { "name": "wtCustGender", "value": "${customer.wtCustGender}" } );
					aoData.push( { "name": "wtCustPhone", "value": "${customer.wtCustPhone}" } );
					aoData.push( { "name": "wtCustWorkAddress", "value": "${customer.wtCustWorkAddress}" } );
					aoData.push( { "name": "wtCustAddress", "value": "${customer.wtCustAddress}" } );
					aoData.push( { "name": "wtPlanId", "value": "${customer.wtPlanId}" } );
					aoData.push( { "name": "wtCustToUser", "value": "${customer.wtCustToUser}" } );
					aoData.push( { "name": "startTime", "value": "${customer.startTime}" } );
					aoData.push( { "name": "endTime", "value": "${customer.endTime}" } );
					aoData.push( { "name": "orgId", "value": "${customer.orgId}" } );
			},
			"sAjaxSource": "${ctx}/customer/list.do",
			"fnServerData": fnDataTablesPipeline,
			"sServerMethod": "POST"
		});
	
	//点击行变色
	var active_class2 = 'success';
	$('#customerListTable').on('click', 'tbody tr' , function(){
		var $row = $(this).closest('tr');	
		if ($row.hasClass(active_class2) == false) {
			dataTables.$('tr.' + active_class2).removeClass(active_class2);
			$row.addClass(active_class2);				
		}
	});
	
});

</script>